package cn.ibizlab.todo.core.pms.client;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.todo.core.pms.domain.User;
import cn.ibizlab.todo.core.pms.filter.UserSearchContext;
import org.springframework.cloud.openfeign.FeignClient;

/**
 * 实体[User] 服务对象接口
 */
@FeignClient(value = "${ibiz.ref.service.pms-webapi:pms-webapi}", contextId = "User", fallback = UserFallback.class)
public interface UserFeignClient {

    @RequestMapping(method = RequestMethod.GET, value = "/users/select")
    Page<User> select();


    @RequestMapping(method = RequestMethod.POST, value = "/users")
    User create(@RequestBody User user);

    @RequestMapping(method = RequestMethod.POST, value = "/users/batch")
    Boolean createBatch(@RequestBody List<User> users);


    @RequestMapping(method = RequestMethod.PUT, value = "/users/{id}")
    User update(@PathVariable("id") Long id,@RequestBody User user);

    @RequestMapping(method = RequestMethod.PUT, value = "/users/batch")
    Boolean updateBatch(@RequestBody List<User> users);


    @RequestMapping(method = RequestMethod.DELETE, value = "/users/{id}")
    Boolean remove(@PathVariable("id") Long id);

    @RequestMapping(method = RequestMethod.DELETE, value = "/users/batch}")
    Boolean removeBatch(@RequestBody Collection<Long> idList);


    @RequestMapping(method = RequestMethod.GET, value = "/users/{id}")
    User get(@PathVariable("id") Long id);


    @RequestMapping(method = RequestMethod.GET, value = "/users/getdraft")
    User getDraft();


    @RequestMapping(method = RequestMethod.POST, value = "/users/checkkey")
    Boolean checkKey(@RequestBody User user);


    @RequestMapping(method = RequestMethod.POST, value = "/users/save")
    Boolean save(@RequestBody User user);

    @RequestMapping(method = RequestMethod.POST, value = "/users/savebatch")
    Boolean saveBatch(@RequestBody List<User> users);



    @RequestMapping(method = RequestMethod.POST, value = "/users/searchdefault")
    Page<User> searchDefault(@RequestBody UserSearchContext context);



    @RequestMapping(method = RequestMethod.POST, value = "/users/searchtaskteam")
    Page<User> searchTaskTeam(@RequestBody UserSearchContext context);


}
